package com.itheima.api.client;

import com.itheima.api.client.dto.TBannerDto;
import com.itheima.api.client.dto.Tag;
import com.itheima.api.client.dto.TagDto;
import com.itheima.api.client.fallback.AdminClientFallbackFactory;
import com.itheima.common.domain.PageReqDto;
import com.itheima.common.domain.PageResDto;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "blog-admin",
        configuration = FeignClientConfig.class,
        fallbackFactory = AdminClientFallbackFactory.class)
public interface AdminClient {

    @PostMapping("/tag/getList")
    public List<TagDto> getTagList();

    @GetMapping("/tag/listWithIds")
    public List<Tag> listWithIds(@RequestParam List<Integer> tagIds);

    @GetMapping("/category/list")
    List<String> classificationList();

    @GetMapping("/banner/list")
    PageResDto<TBannerDto> findPage(@SpringQueryMap PageReqDto pageReqDto);

}
